Winter 2026 Day 5
EOF is written into the pipe. Since the child is the only other process that could write to the pipe and the child exits without writing anything, and the parent has not closed its write end, the parent will block indefinitely.read()libc.so mapped into all running C programsread()), and the data is copied directly into the user-mode portion of memorymmap a file, but do some trickery beforehand and use special filesname → fd → mmaptmpfs (/dev/shm)shm_open()) IPC may not work in your favor in macOSshmget(): allocateshmat(): attachshmdt(): detachshmctl(): control (destroy with IPC_RMID) “Gemini, make an image in the style of a video game pitting pipes versus shared memory”
What isn’t clear?
Comments? Thoughts?
What isn’t clear?
Comments? Thoughts?
Calculate the average waiting time:
Order: P1, P2, P3
Waiting time P1 = 0; P2 = 24; P3 = 27
Average waiting time: \((0 + 24 + 27)/3 = 17\)
Order P2, P3, P1
Waiting time P1 = 6; P2 = 0; P3 = 3
Average waiting time: \((6 + 0 + 3)/3 = 3\)
Process Burst Time
P1 24
P2 3
P3 3
Process Burst Time
P1 6
P2 8
P3 7
P4 3
Process Arrival Time Burst Time
P1 0 8
P2 1 4
P3 2 9
P4 3 5
What isn’t clear?
Comments? Thoughts?
Batch Scheduling
Interactive Scheduling
Average waiting time: \[[(10-4) + 4 + 7] = 17/3 = 5.66\]
Pros:
Cons?
Process Burst Time
P1 24
P2 3
P3 3
Quantum = 4
All have downsides
Those that optimize turnaround / wait, can harm response time
Those that optimize response time, can harm turnaround, wait
What should we do?
Rule 1: If Priority(A) > Priority(B), A runs (B doesn’t)
Rule 2: If Priority(A)=Priority(B), A & B run in RR
Rule 3: When a job enters the system, it is placed at the highest priority (the topmost queue)
Rule 4a: If a job uses up its allotment while running, its priority is reduced (i.e., it moves down one queue)
Rule 4b: If a job gives up the CPU (for example, by performing an I/O operation) before the allotment is up, it stays at the same priority level (i.e., its allotment is reset)
Any problems with these???
What isn’t clear?
Comments? Thoughts?